package com.xinsilu.product.controller;


import com.xinsilu.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/product")
public class ProductController {
    @Autowired
    private ProductService productService;

    @RequestMapping("/saveOrder")
    public synchronized Object saveOrder(int id,int buyCount){
        return  productService.saveOrder(id, buyCount);

    }

    @RequestMapping("/saveOrderRedis")
    public  Object saveOrderRedis(String id,int buyCount){
        return  productService.saveOrderRedis(id, buyCount);

    }

    @RequestMapping("/saveOrderLua")
    public  Object saveOrderLua(String id,int buyCount){
        return  productService.saveOrderLua(id,buyCount);

    }



}
